﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/Layouts/Admin.Master" AutoEventWireup="true"
    CodeBehind="MyOrderDetail.aspx.cs" Inherits="MLM.AdminCP.Pages.MyOrderDetail"
    meta:resourcekey="PageResource1" %>

<%@ Import Namespace="MLM.AdminCP.Class" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ID="idMyOrder" runat="server" Text="My Order Detail" meta:resourcekey="idMyOrderResource1"></asp:Label>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <h3>
        <asp:Label ID="lbOrderInformation" runat="server" Text="Order Information" meta:resourcekey="lbOrderInformationResource1"></asp:Label>
    </h3>
    <asp:FormView ID="FormView1" runat="server" DataSourceID="ProductOrderEds" meta:resourcekey="FormView1Resource1">
        <ItemTemplate>
            <table class="MLMInfoTable" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <b>
                            <asp:Label ID="OrderID" runat="server" Text="Order ID" meta:resourcekey="OrderIDResource1"></asp:Label></b>
                    </td>
                    <td>
                        <%#Eval("InvoiceID") %>
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>
                            <asp:Label ID="UseID" runat="server" Text="User ID" meta:resourcekey="UseIDResource1"></asp:Label></b>
                    </td>
                    <td>
                        <%#Eval("UserID") %>
                        (<%#Eval("User.FirstName") %><%#Eval("User.LastName") %>)
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>
                            <asp:Label ID="Depo" runat="server" Text="Depo" meta:resourcekey="DepoResource1"></asp:Label></b>
                    </td>
                    <td>
                        <%#Eval("DepoID") %>
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>
                            <asp:Label ID="CreatedDate" runat="server" Text="Created Date" meta:resourcekey="CreatedDateResource1"></asp:Label></b>
                    </td>
                    <td>
                        <%#Eval("DateTimeCreated") %>
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>
                            <asp:Label ID="Status" runat="server" Text="Status" meta:resourcekey="StatusResource1"></asp:Label></b>
                    </td>
                    <td>
                        <%# long.Parse(Eval("Status").ToString())==-1?"<span style='color:orange;'>Pending</span>":(long.Parse(Eval("Status").ToString())==1?"<span style='color:green;'>Complete</span>":"<span style='color:red'>Cancelled</span>") %>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </asp:FormView>
    <br />
    <asp:Panel runat="server" ID="PanelChangeStatus" meta:resourcekey="PanelChangeStatusResource1">
        <div>
            Change Status:
            <telerik:RadComboBox runat="server" ID="StatusSelect" meta:resourcekey="StatusSelectResource1">
                <Items>
                    <telerik:RadComboBoxItem runat="server" Text="Cancel" Value="2" meta:resourcekey="RadComboBoxItemResource1"
                        Owner="" />
                </Items>
            </telerik:RadComboBox>
            <asp:Button runat="server" Text="Save" ID="SaveChangeStatus" meta:resourcekey="SaveChangeStatusResource1" />
        </div>
    </asp:Panel>
    <h3>
        <asp:Label ID="lbOrderDetail" runat="server" meta:resourcekey="lbOrderDetailResource1"></asp:Label>
    </h3>
    <table class="MLMInfoTable" cellpadding="0" cellspacing="0">
        <tr>
            <th>
                <asp:Label ID="Product" runat="server" Text="Product" meta:resourcekey="ProductResource1"></asp:Label>
            </th>
            <th>
                <asp:Label ID="VAT" runat="server" Text="VAT" meta:resourcekey="VATResource1"></asp:Label>
            </th>
            <%= "\"<th><asp:Label ID=\"Point\" runat=\"server\" Text=\"Point\" meta:resourcekey=\"PointResource1\"></asp:Label></th>\"".DisplayAcess() %>
            <th>
                <asp:Label ID="Quantity" runat="server" Text="Quantity" meta:resourcekey="QuantityResource1"></asp:Label>
            </th>
            <th>
                <asp:Label ID="Price" runat="server" Text="Price" meta:resourcekey="PriceResource1"></asp:Label>
            </th>
            <%="<th><asp:Label ID=\"Label1\" runat=\"server\" Text=\"Price With out tax\"></asp:Label></th>".DisplayAcess() %>
            <th>
                <asp:Label ID="Total" runat="server" Text="Total Price" meta:resourcekey="TotalResource1"></asp:Label>
            </th>
            <%="<th><asp:Label ID=\"TotalPV\" runat=\"server\" Text=\"Total PV\" meta:resourcekey=\"TotalPVResource1\"></asp:Label></th>".DisplayAcess()%>
        </tr>
        <asp:Repeater ID="RptInvoiceDetail" runat="server" DataSourceID="ProductOrderDetailEds">
            <ItemTemplate>
                <tr>
                    <td>
                        <%#Eval("ProductBas.Name") %>
                    </td>
                    <td>
                        <%#Eval("VAT") %>
                    </td>
                    <%#string.Format("<td>{0}PV</td>".DisplayAcess(), Eval("Point"))%>
                    <td>
                        <%#Eval("Quantity") %>
                    </td>
                    <td>
                        <%# FormatPrice(Eval("Price"),0)%></p>
                    </td>
                    <%#string.Format("<td>{0}</td>".DisplayAcess(),Eval("Price"))%>
                    <%#string.Format("<td>{0}</td>".DisplayAcess(), PriceUtil.FormatPrice(Eval("Price"), -1, dtct, PriceUtil.GetRole(dtct, Eval("Invoice.UserID")), Eval("ProductBaseID"), PriceUtil.GetCountry(dtct, Eval("Invoice.UserID"))))%>
                    <td>
                        <%# FormatPrice((float.Parse((Eval("Price").ToString())) * long.Parse((Eval("Quantity") ?? "0").ToString())), 0)%>
                    </td>
                    <%#string.Format( "<td>{0}</td>".DisplayAcess(),(float.Parse(Eval("Point").ToString()) * long.Parse(Eval("Quantity").ToString())))%>
                </tr>
            </ItemTemplate>
        </asp:Repeater>
    </table>
    <asp:EntityDataSource ID="ProductOrderEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EntitySetName="Invoices" Include="User"
        AutoGenerateWhereClause="True">
        <WhereParameters>
            <asp:QueryStringParameter runat="server" Name="InvoiceID" QueryStringField="ID" ConvertEmptyStringToNull="true"
                Type="Int64" />
            <asp:SessionParameter runat="server" Name="UserID" SessionField="CurrentUserId" Type="Int64" />
        </WhereParameters>
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="ProductOrderDetailEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EntitySetName="InvoiceDetails" Include="ProductBas,Invoice"
        AutoGenerateWhereClause="True">
        <WhereParameters>
            <asp:QueryStringParameter runat="server" Name="InvoiceID" QueryStringField="ID" ConvertEmptyStringToNull="true"
                Type="Int64" />
        </WhereParameters>
    </asp:EntityDataSource>
</asp:Content>
